package com.haiya.identityaccess.infrastructure.persistence.mybatis.mapper;

import com.haiya.db.mapper.SuperMapper;
import com.haiya.identityaccess.infrastructure.persistence.mybatis.datamodel.DataTenant;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

/**
 * @author qiaoguoqiang
 */
@Mapper
public interface TenantMapper extends SuperMapper<DataTenant> {
    /**
     * 根据租户ID查询租户
     * @param id
     * @return
     */
    DataTenant tenantOfId(@Param("id") String id);

    /**
     * 根据租户名称查询租户
     * @param aName
     * @return
     */
    DataTenant tenantNamed(@Param("name") String aName);

    /**
     * 删除给定租户ID的租户
     * @param id
     */
    void remove(@Param("id") String id);
}
